import {defineStore} from "pinia";
import {getList} from "@/api/web/adopt.js";



const useAdoptStore = defineStore(
    'adopt',
    {
        state: () => ({
                //审核中
                adoptList1:[],
                //审核后
                adoptList2:[]
        }),
        getters: {

        },
        actions: {
                // 审核中的申请 status =0
                getList1(customerId:number){
                        return new Promise(async (resolve, reject) => {
                                getList(customerId,0).then((res:any)=>{
                                        console.log(res.rows)
                                        this.adoptList1 = res.rows
                                })
                        })
                },
                // 审核中的申请 status =1  或 2
                getList2(customerId:number){
                        return new Promise(async (resolve, reject) => {
                                getList(customerId,1).then((res:any)=>{
                                        console.log(res.rows)
                                        this.adoptList2 = res.rows
                                })
                        })

                },

        },

    })



export default useAdoptStore
